package freespiritsocial.io.user.event

import com.google.android.libraries.places.api.model.Place
import com.sendbird.android.BaseChannel
import com.sendbird.android.BaseMessage
import freespiritsocial.io.user.data.model.UploadPostEvent
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.callback.livedata.UnPeekLiveData
import me.hgj.jetpackmvvm.callback.livedata.event.EventLiveData

/**
 * 描述　:APP全局的ViewModel，可以在这里发送全局通知替代EventBus，LiveDataBus等
 */
class EventViewModel: BaseViewModel() {

    val keyBoardShowEvent = EventLiveData<Boolean>()

    val placeSelectEvent = EventLiveData<Pair<Place,Int>>()

    val tagSelectEvent = EventLiveData<String>()

    val uploadEvent = EventLiveData<UploadPostEvent>()

    val changeEmailEvent = EventLiveData<String>()

    //====播放器事件=======
    val playPosition = EventLiveData<Int>()

    //=====帖子事件=====
    val savePostEvent = EventLiveData<Long>()
    val hidePostEvent = EventLiveData<Long>()
    val likePostEvent = EventLiveData<Long>()
    val delPostEvent = EventLiveData<Long>()
    val updatePostEvent = UnPeekLiveData<Long>()

    //=====用户事件=====
    //关注事件
    val attentionEvent = EventLiveData<String>()

    //=====消息事件=====
    val hasUnReadMessage = EventLiveData<Boolean>()
    val messageReceivedEvent = EventLiveData<Pair<BaseChannel,BaseMessage>>()
    val messageDelEvent = EventLiveData<Pair<BaseChannel,Long>>()
    val messageUpdatedEvent = EventLiveData<Pair<BaseChannel,BaseMessage>>()
    val channelChangedEvent = EventLiveData<BaseChannel>()

    val changeMainTag = UnPeekLiveData<Int>()

    // TODO: 2022/1/25 待完善
    val onBackPressed = UnPeekLiveData<String>()
}